﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace QH_MSS_WPF_Core.UserControls
{
    /// <summary>
    /// StationUserControl.xaml 的交互逻辑
    /// </summary>
    public partial class StationUserControl : UserControl
    {
        public StationUserControl()
        {
            InitializeComponent();
            ButtonAndEclipse.DataContext = this;
        }



        public static readonly DependencyProperty StringProperty = DependencyProperty.Register("StationName", typeof(String), typeof(StationUserControl));
        public string StationName
        {
            get { return (string)GetValue(StringProperty); }
            set { SetValue(StringProperty, value); }
        }


        public static readonly DependencyProperty IntProperty = DependencyProperty.Register("Station", typeof(int), typeof(StationUserControl));
        public int Station
        {
            get { return (int)GetValue(IntProperty); }
            set { SetValue(IntProperty, value); }
        }




        public static readonly DependencyProperty CommandProperty =
            DependencyProperty.Register("Command", typeof(ICommand), typeof(StationUserControl), new PropertyMetadata(null));

        public ICommand Command
        {
            get { return (ICommand)GetValue(CommandProperty); }
            set { SetValue(CommandProperty, value); }
        }


        public static readonly DependencyProperty CommandParameterProperty =
       DependencyProperty.Register("CommandParameter", typeof(object), typeof(StationUserControl), new PropertyMetadata(null, OnCommandParameterCallback));

        private static void OnCommandParameterCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {

        }

        /// <summary>
        /// 获取或设置CommandParameter的值
        /// </summary>  
        public object CommandParameter
        {
            get { return (object)GetValue(CommandParameterProperty); }
            set { SetValue(CommandParameterProperty, value); }
        }
    }
}
